;; This  file is free  software; you  can redistribute  it and/or
;; modify it under the terms of the GNU General Public License as
;; published by  the Free Software Foundation;  either version 3,
;; or (at your option) any later version.

;; This file is  distributed in the hope that  it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR  A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You  should have  received a  copy of  the GNU  General Public
;; License along with  GNU Emacs; see the file  COPYING.  If not,
;; write  to  the Free  Software  Foundation,  Inc., 51  Franklin
;; Street, Fifth Floor, Boston, MA 02110-1301, USA.


(defun lian-theme-misc ()
  (interactive)
  (message "lian-theme-misc is loading")
  ;; disable highlight-underline-face
  (disable-hl-underline-face)
  ;; my fonts
  ;; 中文字体在fedora或者其它系统上总有怪现象，解决思路如下：
  ;; 1. DejaVu Sans Mono 下载放在你的~/.fonts
  ;; 2. 下载文泉驿正黑也到上面那个目录
  ;; 3. cd ~/.fonts; mkfontscale; mkfontdir; fc-cache;
  ;; 4. 下载那些字体包之后要把其中的*.ttf,*.ttc拷贝到~/.fonts
  ;; 5. 这样配合下面脚本基本上不会出问题字体就很好看了.

  ;; For terminal  
  (if (not window-system)
       (progn
        (message "Terminal theme is loading...")))
  
  ;; For cygwin
  (if (string-equal system-type "cygwin")
      (progn
        (message "Cygwin theme is loading")
        (add-to-list 'default-frame-alist '(font . "Consolas-10"))))

  ;; For window-nt compiled as a native w32 application
  (if (string-equal system-type "windows-nt")      
      (progn
        ((message "Windows-nt theme is loading"))
         (require 'my-fontset-win)
        (huangq-fontset-consolas 14)))
  
  ;; For Gnu/Linux
  (if (string-equal system-type "gnu/linux")
      (progn
        (message "GNU/Linux theme is loading")
        (require 'my-fontset-win)
        (huangq-fontset-consolas 14))))

(defun lian-after-make-frame-settings (frame)
  (setq color-theme-is-global nil)
  (select-frame frame)
  (color-theme-lian))


(defun color-theme-lian ()
  (interactive)
  (color-theme-ahei)
  (lian-theme-misc))

(add-hook 'after-make-frame-functions 'lian-after-make-frame-settings)

;; Disable default split-window-sensibly 
;; (defun no-split-window ()
;;   (interactive)
;;   nil)
;; (setq split-window-preferred-function 'no-split-window)

(provide 'lian-theme-settings)
